<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Box2D: b2BodyDef Struct Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="icon.gif"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Box2D
   &#160;<span id="projectnumber">2.2.1</span>
   </div>
   <div id="projectbrief">A 2D Physics Engine for Games</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">b2BodyDef Struct Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="b2BodyDef" -->
<p><code>#include &lt;<a class="el" href="b2_body_8h_source.html">b2Body.h</a>&gt;</code></p>

<p><a href="structb2_body_def-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a87bee47596b3b3eced0d9dd1f4c18fee"></a><!-- doxytag: member="b2BodyDef::b2BodyDef" ref="a87bee47596b3b3eced0d9dd1f4c18fee" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a87bee47596b3b3eced0d9dd1f4c18fee">b2BodyDef</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This constructor sets the body definition default values. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">b2BodyType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a89cc3ad1873908042b002147b3861381">type</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structb2_vec2.html">b2Vec2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a680cadc09ad6cf4b3366cbf0914c648b">position</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a564b16f4f8e9fcb5dda397e64aa9be6f"></a><!-- doxytag: member="b2BodyDef::angle" ref="a564b16f4f8e9fcb5dda397e64aa9be6f" args="" -->
float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a564b16f4f8e9fcb5dda397e64aa9be6f">angle</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The world angle of the body in radians. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25fa5aa78d93159c344241af95bec2bf"></a><!-- doxytag: member="b2BodyDef::linearVelocity" ref="a25fa5aa78d93159c344241af95bec2bf" args="" -->
<a class="el" href="structb2_vec2.html">b2Vec2</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a25fa5aa78d93159c344241af95bec2bf">linearVelocity</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The linear velocity of the body's origin in world co-ordinates. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="add7809f7a29656b8c4b643ad8c2f34a9"></a><!-- doxytag: member="b2BodyDef::angularVelocity" ref="add7809f7a29656b8c4b643ad8c2f34a9" args="" -->
float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#add7809f7a29656b8c4b643ad8c2f34a9">angularVelocity</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The angular velocity of the body. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a728f6df3be7dedb331455105e3659d46">linearDamping</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a01b8dc8ad9f0962efef9e4a8e836feb6">angularDamping</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a0765068172e521ed63cb34084c59c003">allowSleep</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a17a8102638aac41e7ab94278651a45bd"></a><!-- doxytag: member="b2BodyDef::awake" ref="a17a8102638aac41e7ab94278651a45bd" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a17a8102638aac41e7ab94278651a45bd">awake</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Is this body initially awake or sleeping? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a273a51c57440a8884de5939d76b6e3ea"></a><!-- doxytag: member="b2BodyDef::fixedRotation" ref="a273a51c57440a8884de5939d76b6e3ea" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a273a51c57440a8884de5939d76b6e3ea">fixedRotation</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should this body be prevented from rotating? Useful for characters. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586">bullet</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf6f3e9a9e124e080c68bc0edeb170df"></a><!-- doxytag: member="b2BodyDef::active" ref="adf6f3e9a9e124e080c68bc0edeb170df" args="" -->
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#adf6f3e9a9e124e080c68bc0edeb170df">active</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Does this body start out active? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae457dd1d39be09945eace6061121be29"></a><!-- doxytag: member="b2BodyDef::userData" ref="ae457dd1d39be09945eace6061121be29" args="" -->
void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#ae457dd1d39be09945eace6061121be29">userData</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Use this to store application specific body data. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aadea3fa173ed1014739ec8b023de4336"></a><!-- doxytag: member="b2BodyDef::gravityScale" ref="aadea3fa173ed1014739ec8b023de4336" args="" -->
float32&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structb2_body_def.html#aadea3fa173ed1014739ec8b023de4336">gravityScale</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Scale the gravity applied to this body. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions. Shapes are added to a body after construction. </p>
</div><hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a0765068172e521ed63cb34084c59c003"></a><!-- doxytag: member="b2BodyDef::allowSleep" ref="a0765068172e521ed63cb34084c59c003" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="structb2_body_def.html#a0765068172e521ed63cb34084c59c003">b2BodyDef::allowSleep</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set this flag to false if this body should never fall asleep. Note that this increases CPU usage. </p>

</div>
</div>
<a class="anchor" id="a01b8dc8ad9f0962efef9e4a8e836feb6"></a><!-- doxytag: member="b2BodyDef::angularDamping" ref="a01b8dc8ad9f0962efef9e4a8e836feb6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float32 <a class="el" href="structb2_body_def.html#a01b8dc8ad9f0962efef9e4a8e836feb6">b2BodyDef::angularDamping</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Angular damping is use to reduce the angular velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large. </p>

</div>
</div>
<a class="anchor" id="a7c0047c9a98a1d20614eeddcdbce7586"></a><!-- doxytag: member="b2BodyDef::bullet" ref="a7c0047c9a98a1d20614eeddcdbce7586" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="structb2_body_def.html#a7c0047c9a98a1d20614eeddcdbce7586">b2BodyDef::bullet</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Is this a fast moving body that should be prevented from tunneling through other moving bodies? Note that all bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies. </p>
<dl class="warning"><dt><b>Warning:</b></dt><dd>You should use this flag sparingly since it increases processing time. </dd></dl>

</div>
</div>
<a class="anchor" id="a728f6df3be7dedb331455105e3659d46"></a><!-- doxytag: member="b2BodyDef::linearDamping" ref="a728f6df3be7dedb331455105e3659d46" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float32 <a class="el" href="structb2_body_def.html#a728f6df3be7dedb331455105e3659d46">b2BodyDef::linearDamping</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Linear damping is use to reduce the linear velocity. The damping parameter can be larger than 1.0f but the damping effect becomes sensitive to the time step when the damping parameter is large. </p>

</div>
</div>
<a class="anchor" id="a680cadc09ad6cf4b3366cbf0914c648b"></a><!-- doxytag: member="b2BodyDef::position" ref="a680cadc09ad6cf4b3366cbf0914c648b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structb2_vec2.html">b2Vec2</a> <a class="el" href="structb2_body_def.html#a680cadc09ad6cf4b3366cbf0914c648b">b2BodyDef::position</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The world position of the body. Avoid creating bodies at the origin since this can lead to many overlapping shapes. </p>

</div>
</div>
<a class="anchor" id="a89cc3ad1873908042b002147b3861381"></a><!-- doxytag: member="b2BodyDef::type" ref="a89cc3ad1873908042b002147b3861381" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">b2BodyType <a class="el" href="structb2_body_def.html#a89cc3ad1873908042b002147b3861381">b2BodyDef::type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The body type: static, kinematic, or dynamic. Note: if a dynamic body would have zero mass, the mass is set to one. </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="b2_body_8h_source.html">b2Body.h</a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Sat Sep 17 2011 17:35:55 for Box2D by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
